package com.demo.dao;

import com.demo.entity.Stu_desire;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface Stu_desireMapper {
    @Delete({
        "delete from stu_desire",
        "where did = #{did,jdbcType=VARCHAR}"
    })
    int deleteByPrimaryKey(String did);

    @Insert({
        "insert into stu_desire (did, first_desire, ",
        "second_desire, third_desire, ",
        "first_optty, second_optty, ",
        "third_optty)",
        "values (#{did,jdbcType=VARCHAR}, #{firstDesire,jdbcType=VARCHAR}, ",
        "#{secondDesire,jdbcType=VARCHAR}, #{thirdDesire,jdbcType=VARCHAR}, ",
        "#{firstOptty,jdbcType=INTEGER}, #{secondOptty,jdbcType=INTEGER}, ",
        "#{thirdOptty,jdbcType=INTEGER})"
    })
    int insert(Stu_desire record);

    int insertSelective(Stu_desire record);

    @Select({
        "select",
        "did, first_desire, second_desire, third_desire, first_optty, second_optty, third_optty",
        "from stu_desire",
        "where did = #{did,jdbcType=VARCHAR}"
    })
    @ResultMap("BaseResultMap")
    Stu_desire selectByPrimaryKey(String did);

    int updateByPrimaryKeySelective(Stu_desire record);

    @Update({
        "update stu_desire",
        "set first_desire = #{firstDesire,jdbcType=VARCHAR},",
          "second_desire = #{secondDesire,jdbcType=VARCHAR},",
          "third_desire = #{thirdDesire,jdbcType=VARCHAR},",
          "first_optty = #{firstOptty,jdbcType=INTEGER},",
          "second_optty = #{secondOptty,jdbcType=INTEGER},",
          "third_optty = #{thirdOptty,jdbcType=INTEGER}",
        "where did = #{did,jdbcType=VARCHAR}"
    })
    int updateByPrimaryKey(Stu_desire record);

}